Finder memory leak in macOS Sonoma 14.1.1

I’m very grateful to Neal, who has reported a memory leak affecting the Finder in all versions of macOS Sonoma up to and including 14.1.1. Although generally quite small and unlikely to cause much of a problem in general use, in the right circumstances this can become severe enough to require the Finder to be relaunched.

To reproduce this, watch Finder memory using Activity Monitor while making various selections of files in a Finder window set in a gallery. Neal often browses a hundred or more JPEG images in a gallery view, making multiple selections within them. This consumes memory and drives that being used by the Finder inexorably higher, until it’s using several GB.

However, while that might appear to be an edge case, making repeated selections in a gallery view will almost invariably cause the Finder to use more memory, which it never releases.

memleak1

I’ve tested here on both Intel T2 and Apple silicon Macs running Sonoma 14.1.1, with the same results. When the Finder has been used only lightly, it may take less than 80 MB to start with, when just a column view is open. Switch that to gallery, and with just one text file selected, use rose by 30 MB. Select most but not all of 80 files of mixed types and memory used rose by another 80 MB.

memleak2

Select just one file, then another large group, and it rises another 40 MB or so. In a few minutes of repeatedly selecting groups of files within the gallery, the Finder was taking over 800 MB in total. Set that window back to column view, or close it altogether, and that memory isn’t freed up again. If the Finder is left a couple of days without any further use being made of gallery view, its inflated memory will remain unchanged.

memleak3

This will most affect those like Neal who make multiple selections in gallery view. There doesn’t appear to be any workaround, other than to keep an eye on the Finder’s memory use, and to relaunch it using the Force Quit Applications dialog when necessary.

Neal has already reported this to Apple (in Feedback FB13373810), but if you’d like to add your own Feedback to amplify his report, please do so.

There’s no excuse for memory leaks like this, although they’re not uncommon (and I admit to my own guilt). Apple’s Xcode has a very capable memory leak detection instrument, and all software should be tested against that long before it’s released to the public.

Summary of conditions to cause significant leaks

  • Finder window in gallery view,
  • many files in that folder,
  • many of them JPEG images,
  • repeated selections of multiple files in the view.